package day12.abstractfactory.product2;

import day12.abstractfactory.AbstractFactory;

public class AnimalFactory implements AbstractFactory {
    public final static String ANIMAL_PIG = "pig";
    public final static String ANIMAL_DOG = "dog";
    public final static String ANIMAL_CAT = "cat";

    public Animal getAnimal(String animal) {
        switch (animal) {
            case ANIMAL_PIG: return new Pig();
            case ANIMAL_DOG: return new Dog();
            case ANIMAL_CAT: return new Cat();
            default: return null;
        }
    }
}
